Skip to content

Comments: drop port/audit tags and line citations (Windows, Dart, tooling) - #53

Merged
wenkaifan0720 merged 2 commits into
mainfrom
chore/comment-sweep
Sep 24, 2026
Merged

wenkaifan0720 merged 2 commits into
mainfrom
chore/comment-sweep

Conversation

@wenkaifan0720

Copy link
Copy Markdown
Collaborator

Comments and docs written during the Windows port and the audits refer to things a new reader can't look up:

  • Tags: LAW 1…LAW 10, SLICE, spike ids (S1…S6, S6a, "the S3 recipe", "S1 belt-1"), phase ids (P6, P7, P9, P11, "pre-P9", CEF-1, CEF-2a/2b), audit ids (C1, C2, C3, H3, H7, "sev-8 audit findings"), audit finding numbers #1/#3/#9 (on GitHub these link to unrelated PRs), fix ids F-1…F-6, and PLAN §x.y.
  • Line citations: main.mm:NNN, Swift:NNN, FlutterCefPlugin.swift:NNN, cef_web_controller.dart:NNN and similar. Every main.mm line number has been wrong since macOS: split cef_host's main.mm and CefProfileHost; one record per session #50 split main.mm into nine files.

This PR replaces each tag with the reason it stood for. For example, "size-gate (LAW 4)" now says that CEF keeps delivering frames at the old size after a resize, and the host's "THE LAWS" list is now a list of plain rules. Where a sentence already gave the reason, the tag is simply dropped. Line citations now name the macOS file and function (for example DoSetVisible in browser_ops.mm, failHost in FlutterCefPlugin.swift); each name was checked with grep. Citations that added nothing are gone. specs/... and SPIKES.md pointers are replaced by the reason they stood for.

PROTOCOL.md changes:

  • The method table loses its Slice? and Source (Swift:NNN) columns.
  • The events table loses its Source column, and the cookies table loses its main.mm column.
  • The one fact the Slice column carried that still matters, that showDevTools and the ime* verbs are unverified on Windows OSR, is now a sentence.
  • The prose citations now point at files and functions.
  • The generated opcode section is untouched; dart run tool/protocol/generate.dart makes no change.

The PR also fixes some stale pointers found along the way:

  • In PORTING.md, the table of macOS seams had main.mm line numbers and a g_surface global that no longer exists.
  • PROTOCOL.md gave the wrong path for CdpRelayFilterTests.swift.

Scope: everything except packages/flutter_cef_macos/**, which is swept separately, docs/history/** and the CHANGELOGs.

Counts

With the sweep's counting regex, excluding docs/history, the CHANGELOGs and flutter_cef_macos:

  • Before: 223 matching lines, of which 197 are real tags or citations.
  • After: 28 matching lines, of which 2 are real (see below).
  • The other 26 matches, before and after, are false positives:
    • 10 are bytes in the example's PNG app icons.
    • 16 are in code: (x64) in CONTRIBUTING, %ProgramFiles(x86)%, JS .slice(1), x1)/y0) in the popup blit, *i32)/*i64), and test values like f1), b64), protocolMismatch(host=v3).

A wider scan also catching S/P/C/H/F-n/#n/PLAN §/CEF-2x tags and bare line ranges went from about 330 lines to the handful listed below.

Left in place

  • cef_host_win.cc, OnBeforePopup: a runtime SendLog string still says "post-slice on Windows" and "(macOS OpenNativeAuthPopup, main.mm:1444)". It is log output, not a comment, so this comments-only PR leaves it. It is worth a one-line follow-up.
  • example/lib/multiview_probe.dart: the on-screen label 'P2-step2 probe — …' is a UI string, left for the same reason. The probe's check labels A/D/E/F stay; the file header now defines them.
  • packages/flutter_cef_windows/README.md: "the original port plan and spikes are in docs/history/windows-port/" is a real pointer to the history docs.
  • Legitimate words and references: "keystone" in ci.yaml, "C0 controls" (the Unicode control-character block) in cef_web_view.dart, PROTOCOL.md §n (real sections), commit 855042d, and "CEF t=11650" (a CEF forum thread).

Verification

  • fvm flutter analyze is clean at the root and in example/.
  • fvm flutter test: 280 passed, including the protocol parity test.
  • dart run tool/protocol/generate.dart leaves the tree unchanged.
  • bash -n passes on example/run_leak_soak.sh and example/run_conformance_oracle.sh.
  • For all 13 changed C/C++ files, stripping comments and collapsing whitespace gives the same token stream as main. A deliberate one-token code edit (negative control) did change the stream. So no comment was left unterminated and no // swallowed code.
  • The CMake, PowerShell, shell and Dart diffs change only comment lines.
  • The Windows C++ is compiled by CI's windows-build job.

🤖 Generated with Claude Code

wenkaifan0720 and others added 2 commits September 24, 2026 02:30
…ling)

The Windows port and the audits left comments full of references a new
reader can't resolve: LAW n, SLICE, spike ids (S1..S6), phase ids (P6,
P7, P9, P11), audit ids (C1, H3, H7, #9, F-1), PLAN section numbers, and
main.mm/Swift line numbers that went stale when main.mm was split in #50.

Each tag is replaced by the reason it stood for, or dropped where the
sentence already said it. Line citations become the macOS file and
function they point at (e.g. DoSetVisible in browser_ops.mm), or are
dropped. PROTOCOL.md loses its SLICE and Swift:NNN columns; the
generated opcode section is untouched.

Comments and docs only: the comment-stripped token stream of every
changed C/C++ file is identical to main's.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@wenkaifan0720
wenkaifan0720 merged commit b7ce81c into main Sep 24, 2026
3 checks passed
@wenkaifan0720
wenkaifan0720 deleted the chore/comment-sweep branch September 24, 2026 09:40
wenkaifan0720 added a commit that referenced this pull request Sep 24, 2026
….plist; CI guard (#55)

The macOS plugin and host carried the same unresolvable references #53
removed from Windows/Dart: audit ids (C1-C3, H1-H9, R2, "audit P3"),
the visibility/resize audit's fix ids (F-1..F-6, C-3), the agent-control
plan's phase ids (CEF-1, CEF-2a/b, P2-step1/2), the persistent-profile
contract's section numbers (F.3-F.5, A.4, H.6), a "#138 consolidation"
and pointers to work_canvas's specs/cef-passkey/PLAN.md, another repo.
Each tag is replaced by its reason in words, or dropped where the
sentence already said it. The "[cef] C2 respawn ephemeral host failed"
log line loses its tag too.

entitlements.browser.plist was an auth-spike leftover: nothing signs
with it. The build (CMakeLists.txt) and tool/bundle_cef_host.sh sign
cef_host and every helper with the same file, entitlements.release.plist
for a real identity. Its comment now says so, and why the passkey
keychain group is not in it. The CMakeLists comment claiming both sets
keep allow-unsigned-executable-memory and disable-library-validation is
corrected (only the dev set does). Deleting the file changes the
cef_host input hash.

tool/check_comment_tags.sh fails on the unambiguous shapes (LAW n, the
all-caps slice word, the spike log file name, file.ext:line citations, a
comment that opens with a letter+digits label, a parenthesised label)
outside docs/history/ and CHANGELOGs. CI's analyze-test job runs it.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant